package com.tqz.jvm.cicuitbreaker;

/**
 * <p>
 *
 * @author tianqingzhao
 * @since 2022/10/20 20:17
 */
public class Config {
    
    /**
     * closed进入open的错误个数阈值
     */
    private int failureCount = 5;
    
    /**
     * failureCount 统计时间窗口
     */
    private long failureTimeInterval = 2 * 1000;
    
    /**
     * open 状态进入 half_open 状态的超时时间
     */
    private int halfOpenTimeout = 5 * 1000;
    
    /**
     * half_open 状态进入 open 状态的成功个数阈值
     */
    private int halfOpenSuccessCount = 2;
    
    public int getFailureCount() {
        return failureCount;
    }
    
    public void setFailureCount(int failureCount) {
        this.failureCount = failureCount;
    }
    
    public long getFailureTimeInterval() {
        return failureTimeInterval;
    }
    
    public void setFailureTimeInterval(long failureTimeInterval) {
        this.failureTimeInterval = failureTimeInterval;
    }
    
    public int getHalfOpenTimeout() {
        return halfOpenTimeout;
    }
    
    public void setHalfOpenTimeout(int halfOpenTimeout) {
        this.halfOpenTimeout = halfOpenTimeout;
    }
    
    public int getHalfOpenSuccessCount() {
        return halfOpenSuccessCount;
    }
    
    public void setHalfOpenSuccessCount(int halfOpenSuccessCount) {
        this.halfOpenSuccessCount = halfOpenSuccessCount;
    }
}
